package com.example.myapplication8_2;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.slidingpanelayout.widget.SlidingPaneLayout;

public class MainActivity extends AppCompatActivity {
    private SlidingPaneLayout slidingPaneLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // 初始化SlidingPaneLayout
        slidingPaneLayout = findViewById(R.id.slid_layout);
        slidingPaneLayout.setParallaxDistance(100);  // 设置视差滚动效果距离

        // 配置ListView
        String[] data = {"个人资料", "我的收藏", "我的相册", "设置", "退出"};
        ListView listView = findViewById(R.id.listView1);
        ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, data);
        listView.setAdapter(adapter);
    }
}